package com.qww.test17;

/**
 * @author qww
 * @date 2021-04-05 19:02
 */
public class Test17 {
    public static void main(String[] args) {
        // 可以传入一个Object数组
        printArr(new Object[]{1, 2, 'a', 4, 5, });
        printArr(new Object[]{"as", "df", 1.0, });
        printArr(new Object[]{ 1, "3", new A(), });
        // 也可以传入多个实参
        printArr(1, 2, 'a', new A());
        printArr();
    }

    public static void printArr(Object... args) {
        for (Object obj : args) {
            System.out.print(obj + " ");
        }
        System.out.println();
    }
}

class A { }
